package com.lingkang.usersso.controller;

import com.lingkang.usersso.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * @author linke
 * @date 2020-02-06 下午 12:51
 * @description
 */
@Controller
@RequestMapping("user")
public class UserActionController {

    @Autowired
    private HttpServletRequest request;
    @Autowired
    private UserService userService;

    @GetMapping("list")
    @ResponseBody
    public Object list() {
        int page = Integer.valueOf(request.getParameter("page"));
        int size = Integer.valueOf(request.getParameter("limit"));
        return userService.list(page, size);
    }
}
